﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta content="" name="description" />
    <meta content="JiangZhiYong" name="author" />
    <title>小区管理</title>
	<!-- Bootstrap Styles-->
	<#assign ctx=(rc.getContextPath())!''>
    <link href="${ctx}/assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FontAwesome Styles-->
    <link href="${ctx}/assets/css/font-awesome.css" rel="stylesheet" />
     <!-- Morris Chart Styles-->
   
    <!-- Custom Styles-->
    <link href="${ctx}/assets/css/custom-styles.css" rel="stylesheet" />
     <!-- Google Fonts-->
   <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
     <!-- TABLE STYLES-->
    <link href="${ctx}/assets/js/dataTables/dataTables.bootstrap.css" rel="stylesheet" />
    <link rel="shortcut icon" href="${ctx}/assets/img/favicon.png">
</head>
<body>
    <div id="wrapper">
      	
      	<#include "/common/nav-top.html"/>
        <!--/. NAV TOP  -->
        
        
      <#include "*/common/nav-left.html"/>
        <!-- /. NAV SIDE  -->
      	
       <div id="page-wrapper" >
		  <div class="header"> 
              <h1 class="page-header">
                 	 小区管理 <small>小区设置...</small>
              </h1>
			  <ol class="breadcrumb">
				  <li><a href="${ctx}/home">首页</a></li>
				  <li><a href="${ctx}/community/list">小区</a></li>
				  <li class="active">列表</li>
			  </ol> 
			</div>
		
            <div id="page-inner"> 
               
            <div class="row">
                <div class="col-md-12">
                    <!-- Advanced Tables -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             	小区
                        </div>
                        <div class="panel-body">
                        	<button class="btn btn-primary" id="addCityButton">添加</button>
                        	<br><br>
                            <div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                                    <thead>
                                        <tr>
                                            <th>城市</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    	<#if citys?has_content>
                                    	<#list citys as city>
	                                    	<tr class="odd gradeX">
	                                            <td>${city}</td>
	                                           
	                                            <td class="center">
	                                            <div class="btn-group">
												  <button class="btn btn-primary" onclick="showCommunityDetail('${city}')">详细</button>
												  <button data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button>
												  <ul class="dropdown-menu">
													<li><a href="#" onclick="showCommunityDiv('${city}')">添加</a></li>
													<li><a href="#" onclick="deleteCity('${city}')">删除</a></li>
												  </ul>
												</div>
	                                            </td>
	                                        </tr>
                                    	</#list>
                                    	</#if>
                                    </tbody>
                                </table>
                            </div>
                            
                        </div>
                    </div>
                    <!--End Advanced Tables -->
                </div>
            </div>
            
            <!-- 添加城市 -->
            <div class="row" id="addCityDiv">
               <div class="col-xs-12">					
                   <div class="panel panel-default">
                       <div class="panel-heading">
                           <div class="card-title">
                               <div class="title">添加城市</div>
                           </div>
                       </div>
                       <div class="panel-body">
                           <form class="form-inline">
	                           <div class="form-group">
                                   <label for="addCity_province">省份</label>
                                   <input type="text" class="form-control" id="addCity_province" name="province" placeholder="四川">
                               </div>
                               <div class="form-group">
                                   <label for="addCity_city">城市</label>
                                   <input type="text" class="form-control" id="addCity_city" name="city" placeholder="成都">
                               </div>
                               <button type="button" class="btn btn-default" onclick="addCity()" >添加</button>
                           </form>
                       </div>
                   </div>
               </div>
           </div>
           
           
            <!-- 添加区县 小区 -->
            <div class="row" id="addCommunityDiv">
               <div class="col-xs-12">					
                   <div class="panel panel-default">
                       <div class="panel-heading">
                           <div class="card-title">
                               <div class="title" id="addCommunity_city">服务地址</div>
                           </div>
                       </div>
                       <!--  添加区县 -->
                       <div class="panel-body">
                           <form class="form-inline">
	                           <div class="form-group">
                                   <label for="addCommunity_county">区县</label>
                                   <input type="text" class="form-control" id="addCommunity_county" name="county" placeholder="高新区">
                               </div>
                               <button type="button" class="btn btn-default" onclick="addCounty()" >添加</button>
                           </form>
                       </div>
                       
                        <div class="panel-body">
                           <form class="form-inline">
	                           <div class="form-group">
                                  <!--  <label for="addCity_province">区县</label> -->
                                    <div>
                                        <select class="selectbox" id="addCommunity_countySelect">
                                        </select>
                                    </div>
                                   
                               </div>
                               
                               <div class="form-group">
                                   <label for="addCommunity_community">小区</label>
                                   <input type="text" class="form-control" id="addCommunity_community" name="community" placeholder="XX小区">
                               </div>
                               <button type="button" class="btn btn-default" onclick="addCommunity()" >添加</button>
                           </form>
                       </div>
                   </div>
               </div>
           </div>
           
           <!-- 小区详细显示 -->
              <div class="row" id="cityDetailDiv">
               <div class="col-md-12 col-sm-12">
                   <div class="panel panel-default">
                       <div class="panel-heading" id="cityDetail_city">
                          
                       </div>
                       <div class="panel-body" id="cityDetailPanel">
                           
                       </div>
                   </div>
               </div>
           </div>
                    
                    
                <!-- /. ROW  -->
				<#include "/common/footer.html"/> 
        </div>
             
    </div>
             <!-- /. PAGE INNER  -->
            </div>
         <!-- /. PAGE WRAPPER  -->
     <!-- /. WRAPPER  -->
    <!-- JS Scripts-->
    <!-- jQuery Js -->
    <script src="${ctx}/assets/js/jquery-1.10.2.js"></script>
      <!-- Bootstrap Js -->
    <script src="${ctx}/assets/js/bootstrap.min.js"></script>
    <!-- Metis Menu Js -->
    <script src="${ctx}/assets/js/jquery.metisMenu.js"></script>
     <!-- DATA TABLE SCRIPTS -->
    <script src="${ctx}/assets/js/dataTables/jquery.dataTables.js"></script>
    <script src="${ctx}/assets/js/dataTables/dataTables.bootstrap.js"></script>
    <script src="${ctx}/assets/js/bxb/community.js"></script>
        <script>
            $(document).ready(function () {
                $('#dataTables-example').dataTable();
                $('#addCityDiv').hide();
                $("#addCityButton").click(function(){
                 	$('#addCityDiv').show();
                 });
                $("#addCommunityDiv").hide();
                $("#cityDetailDiv").hide();
            });
            var ctx='${ctx}';
    </script>
         <!-- Custom Js -->
    <script src="assets/js/custom-scripts.js"></script>
    
   
</body>
</html>
